<script>
import { createPromiseDialog } from '@/utils/createPromiseDialog'
import TipDialog from '@/components/TipDialog.vue'
import UserDialog from '@/components/UserDialog.vue'
const tipDialogInstance = createPromiseDialog(TipDialog)
const userDialogInstance = createPromiseDialog(UserDialog)
export default {
  methods:{
    async submit() {
      try {
        await tipDialogInstance()
        const res = await userDialogInstance()
        console.log(res)
      } catch(error) {
        console.log(error)
      }
    }
  }
}
</script>

<template>
  <button @click="submit">按钮</button>
</template>
<style>

</style>
